/*
 * Copyright (c) 2010
 */
package com.mss.fileshareweb;

import org.springframework.web.servlet.mvc.AbstractController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mss.fileshareservice.FilesService;
import com.mss.filesharebean.Files;

import java.util.List;

/**
 * @author: Tony
 */
public class FilesForm extends AbstractController {
    private FilesService filesService;

    public void setFilesService(FilesService filesService) {
        this.filesService = filesService;
    }

    protected ModelAndView handleRequestInternal(HttpServletRequest request,
        HttpServletResponse response) throws Exception {

        List<Files> files = this.filesService.listAll();

        return new ModelAndView("files", "files", files);
    }
}
